#pragma once

#include <string>
#include <unordered_map>
#include <unordered_set>
using namespace std;

class DumpParser {
public:
  // 构造函数，传入文件名
  DumpParser(const std::string &filename) : filename(filename) {}
  DumpParser(const DumpParser &) = delete;
  DumpParser &operator=(const DumpParser &) = delete;
  ~DumpParser(){};

  unordered_map<string, unordered_set<string>> parse();
  bool getFuncStart(const string &asmLine, string &funcName);
  bool getFuncCall(const string &asmLine, string &funcName);
  std::string demangle(const std::string& mangled_name);
  void print(unordered_map<string, unordered_set<string> > &result);
  void print(unordered_map<string, unordered_set<string> > &result, string &startFunc);

private:
  std::string filename;
};

